package com.code.schedule;

import com.code.service.AZPlanStaticIncomeService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 获取XT交易所的兑换数据的定时任务
 *
 * @author tangyifei
 * @since 2020年1月2日19:01:16
 */
@Component
public class AZPlanXTExchangeSchedule {

    @Resource
    private AZPlanStaticIncomeService azPlanStaticIncomeService;

    /**
     * 每间隔5分钟刷新XT交易所的兑换数据
     */
//    @Scheduled(cron = "0/5 * * * * ? ")
    @Scheduled(cron = "0 0/5 * * * ? ")
    @Async
    public void updateXTExchangeRate() {
        azPlanStaticIncomeService.updateXTExchangeRate();
    }

}
